package cn.pinyuan.news.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.pinyuan.news.bean.NewsContent;
import cn.pinyuan.news.service.NewsContentService;
import cn.pinyuan.news.utils.PageResult;

@RestController
public class NewsContentController {

	@Autowired
	private NewsContentService newsContentService;
	
	// 新闻列表
	@RequestMapping("/getNewsContent")
	public List<NewsContent> getNewsContent(){
		System.out.println(newsContentService.getNewsContent());
		return newsContentService.getNewsContent();
	}
	
	//返回分页新闻列表
	@RequestMapping("/getNewsPageContent")
	public PageResult getNewsPageContent(Integer page,Integer size) {
		return newsContentService.getNewsPageContent(page, size);
	}
}
